<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <link rel="stylesheet" href="/static/layui/css/layui.css">

</head>
<body>
<table id="studentTable" lay-filter="studentTable"></table>
</body>

<script src="/static/layui/layui.js"></script>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<script>
  layui.use('table', function(){
    var table = layui.table;

    //第一个实例
    table.render({
      elem: '#studentTable'
      ,height: 312
      ,url: '/students' //数据接口
      ,page: true //开启分页
      ,cols: [[ //表头
        {field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'}
        ,{field: 'username', title: '用户名', width:80}
        ,{field: 'sex', title: '性别', width:80, sort: true}
        ,{field: 'address', title: '地址', width:80}
        ,{field: 'hobby', title: '爱好', width: 177}
        ,{field: 'sno', title: '学号', width: 80, sort: true}
      ]]
    });

  });
</script>
</html>